<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>运行时配置</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="ffi.installation.html">« 安装</a></li>
      <li style="float: right;"><a href="ffi.resources.html">资源类型 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ffi.setup.html">安装/配置</a></li>
    <li>运行时配置</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="ffi.configuration" class="section">
  <h2 class="title">运行时配置</h2>
  <p class="simpara">
这些函数的行为受 <var class="filename">php.ini</var> 中的设置影响。
</p>
  <p class="para">
   <table class="doctable table">
    <caption><strong>FFI 配置选项</strong></caption>
    
     <thead>
      <tr>
       <th>名字</th>
       <th>默认</th>
       <th>可修改范围</th>
       <th>更新日志</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td><a href="ffi.configuration.html#ini.ffi.enable" class="link">ffi.enable</a></td>
       <td>&quot;preload&quot;</td>
       <td>PHP_INI_SYSTEM</td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td><a href="ffi.configuration.html#ini.ffi.preload" class="link">ffi.preload</a></td>
       <td>&quot;&quot;</td>
       <td>PHP_INI_SYSTEM</td>
       <td class="empty">&nbsp;</td>
      </tr>

     </tbody>
    
   </table>

   有关 PHP_INI_* 样式的更多详情与定义，见 <a href="configuration.changes.modes.html" class="xref">配置可被设定范围</a>。
  </p>

  <p class="para">这是配置指令的简短说明。</p>

  <p class="para">
   <dl>
    
     <dt id="ini.ffi.enable">
      <code class="parameter">ffi.enable</code>
      <span class="type">string</span>
     </dt>

     <dd>

      <p class="para">
       Allows enabling (<code class="literal">&quot;true&quot;</code>) or disabling
       (<code class="literal">&quot;false&quot;</code>) FFI API usage, or restricting it only to
       the CLI SAPI and preloaded files (<code class="literal">&quot;preload&quot;</code>).
      </p>
      <p class="para">
       The FFI API restrictions only affect the <span class="classname"><a href="class.ffi.html" class="classname">FFI</a></span> class,
       but not overloaded functions of <span class="classname"><a href="class.ffi-cdata.html" class="classname">FFI\CData</a></span> objects.
       This means that it is possible to create some <span class="classname"><a href="class.ffi-cdata.html" class="classname">FFI\CData</a></span>
       objects in preloaded files, and then to use these directly in PHP scripts.
      </p>
     </dd>

    
    
     <dt id="ini.ffi.preload">
      <code class="parameter">ffi.preload</code>
      <span class="type">string</span>
     </dt>

     <dd>

      <p class="para">
       Allows preloading of FFI bindings during startup, which is not possible with <span class="methodname"><a href="ffi.load.html" class="methodname">FFI::load()</a></span>
       if <a href="opcache.configuration.html#ini.opcache.preload-user" class="link">opcache.preload_user</a> is set.
       This directive accepts a <strong><code>DIRECTORY_SEPARATOR</code></strong> delimited list of filenames.
       The preloaded bindings can be accessed by calling <span class="methodname"><a href="ffi.scope.html" class="methodname">FFI::scope()</a></span>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div></div></div></body></html>